import java.util.ArrayList;

public class Sylph extends Piece {
	/*
	 * 8   - - - - - - - - - - - -    
	 * 7   - - - - - - - - - - - -    
	 * 6   - - m c m - - - - - - -    
	 * 5   - - - S - - - - - - - -    
	 * 4   - - - - - - - - -[m]- -      SKY (3)
	 * 3   - - - - - - - - - - - -    
	 * 2  [m]-[m]-[m]-[m]-[m]-[m]-    
	 * 1   - - - - - - - - - - - -    
	 * 
	 * 8   - - - - - - - - - - - -    
	 * 7   - - - - - - - - - - - -    
	 * 6   - - - - - - - - - - - -    
	 * 5   - - - c - - - - - - - -    
	 * 4   - - - - - - - - -[S]- -      EARTH (2)
	 * 3   - - - - - - - - - - - -    
	 * 2   - - - - - - - - - - - -    
	 * 1   - - - - - - - - - - - -    
     * 	   a b c d e f g h i j k l
	 * 
	 * The Sylph starts on the SkyBoard. It doesn't promote when it reaches the other side of the
	 * board(like most pawns), but it does have the ability to move itself back to a starting
	 * spot from the EarthBoard.
	 */
	
	public Sylph(int s) {
		super(s);
	}
	protected ArrayList<Square> getAvailableMoves() {
		moves.clear();
		if(getSquare().getBoard().getLevel() == 3) {
			moves.add(getSquare().getFarSquare((getSide() - 1) * 180 + 45, 1));
			moves.add(getSquare().getFarSquare(((getSide() - 1) * 180 + 315) % 360, 1));
		} else if(getSquare().getBoard().getLevel() == 2) {
			moves.add(getSquare().getFarSquare(Square.UP, 1));
			for(int i = 1; i <= 12; i += 2) {
				moves.add(new Square(3, 2, i));
			}
		}
		System.out.println(moves);
		return moves;
	}
	protected ArrayList<Square> getAvailableCapts() {
		capts.clear();
		if(getSquare().getBoard().getLevel() == 3) {
			capts.add(getSquare().getFarSquare((getSide() - 1) * 180, 1));
			capts.add(getSquare().getFarSquare(Square.DOWN, 1));
		}
		return capts;
	}
	
	public String toString() {
		if(side == 1) {
			return "S";
		} else if(side == 2) {
			return "s";
		} else {
			return "no side";
		}
	}
}
